package org.urchr.beorganized.api.impl;

import org.urchr.beorganized.api.base.PrivateBaseAPIServlet;
import org.urchr.beorganized.dao.NotesDAO;
import org.urchr.beorganized.dao.errors.GeneralException;
import org.w3c.dom.Element;

public class GetTaggedNotes extends PrivateBaseAPIServlet{

	@Override
	protected void doProcessPrivate() throws GeneralException {
		int noteID = NotesDAO.safeInt(request.getParameter("noteid"), -1);
		
		String tag = "";
		if(xmlObject!=null)
			tag = xmlObject.getAttribute("tag");
		Element list = NotesDAO.getTaggedNotes(noteID, userID, tag);
		sendNode(list);
	}

}
